home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Applications / Commercial Addons / FoxBase / PlotGraph / About plotGraph next >
Encoding:
Text File  |  1993-04-13  |  6.3 KB  |  201 lines  |  [TEXT/FOX+]

  1.  
  2. plotGraph
  3.  
  4. DESCRIPTION
  5.  
  6. plotGraph is an XFCN for generating graphs from within 
  7. FoxBASE+/Mac. It can graph up to 50 data points in a line or bar 
  8. graph, and up to 10 values in a pie chart. Y-Axis values may be 
  9. formatted as "general", currency or percents, and values may be 
  10. automatically scaled, or adjusted to a fixed scale. Fonts and 
  11. styling, background grid, title, X-axis legends, currency symbol 
  12. and currency symbol placement options can also be specified.
  13.  
  14.  
  15. LIMITATIONS 
  16.  
  17. This initial version only supports graphing integer values. The 
  18. maximum value that can be graphed is 4,294,967,295 (2^32 - 1). It 
  19. doesn't currently support color. The character used to separate 
  20. hundreds from thousands, and thousands from millions, etc. (",") 
  21. can't be specified by the user (it's set as a comma).
  22.  
  23.  
  24. THE DIRTY PART
  25.  
  26. There is no charge for personal use of this XFCN. However, if you 
  27. include it in an application for which you are paid to develop 
  28. (e.g., for in-house company use) or for which you charge others 
  29. (e.g., for a client or customer) please send a $20 shareware fee 
  30. to:
  31.  
  32.             Jim Davis
  33.             414 Chestnut Street
  34.             San Francisco, CA 94133
  35.  
  36.  
  37. INSTALLATION
  38.  
  39. Use ResEdit or a similar resource utility to copy XFCN 5000 from 
  40. the file plotGraph. Paste it into your user resource file (e.g., 
  41. your FoxUser file).
  42.  
  43.  
  44. USAGE
  45.  
  46. CALL plotGraph TO result WITH 
  47.      numPoints, data1, data2, outerRect, graphRect, ;
  48.      graphOptions, gFont, graphTitle, xAxisLegend, minMaxValue
  49.  
  50.  
  51. DESCRIPTION OF PARAMETERS
  52.  
  53. numPoints - number of data points to graph. No check is made to 
  54. compare numPoints with actual number of data points passed, so 
  55. make sure this number is correct. Maximum is 50 for line and bar 
  56. charts, and 10 for pie charts.
  57.  
  58. outerRect - the outermost enclosing rectangle, passed as a string 
  59. of four 5-digit values (t,l,b,r).
  60.  
  61. graphRect - enclosing rectangle of graph itself, passed as a 
  62. string of four 5-digit values (t,l,b,r).
  63.  
  64. data1 - first set of data points, passed as string of 10-digit 
  65. integer values, the first 25.
  66.  
  67. data2 - second set of data points, passed as string of 10-digit 
  68. integer values, the second 25 (makes for total of 50 data points). 
  69. (Of course, you only pass as many as you need.)
  70.  
  71. graphOptions - 
  72.  
  73. pos 1: Graph Type:
  74. 'L' = Line
  75. 'B' = Bar
  76. 'P' = Pie
  77.  
  78. pos 2: Format:
  79. '$' = currency with commas, negative values display inside ().
  80. 'G' = commas only
  81. '%' = as percent
  82.  
  83. pos 3: Display X-Axis labels for line or bar graphs, or legend box 
  84. for pie graphs:
  85. 'Y' = display
  86. any other character = don't display
  87.  
  88. pos 4: Display Y-axis labels for line and bar graphs, or %age 
  89. labels for pie slices
  90. 'Y' = display
  91. any other character = don't display
  92.  
  93. pos 5: Currency symbol
  94.  
  95. pos 5: Placement of currency symbol:
  96. 'B' = before number
  97. 'A' = after number
  98.  
  99. pos 6: Scaling option:
  100. 'A' = auto scaling
  101. 'F' = fixed scaling
  102.  
  103. pos 7: Show vertical grid lines:
  104. 'Y' = show vertical grid lines
  105. any other character = don't show vertical grid lines
  106.  
  107. pos 8: Show horizontal grid lines:
  108. 'Y' = show horizontal grid lines
  109. any other character = don't show vertical grid lines
  110.  
  111.  
  112. gFont - Font for Y-Axis and X-Axis legends, passed as 
  113. fontName;fontSize. fontSize uses Fox convention for adding style.
  114.  
  115. graphTitle - Title for graph (centered at top). Passed as 
  116. title;font;fontSize.  fontSize uses Fox convention for adding 
  117. style.
  118.  
  119. xAxisLegend - legend for X-Axis. If a bar or line graph, passed as 
  120. string of 50 5-character values. If a pie chart, passed as 10 25-
  121. character values.
  122.  
  123. minMaxValue - for line and bar graphs, contains a 10 character 
  124. minimum graph value, and 10 character maximum graph value, and a 
  125. 10 character value of the number of steps to show along the Y-
  126. axis. For auto-scaled line and bar graphs, the minimum and maximum 
  127. graph values are ignored. For pie charts, this contains a single 
  128. value, the width of the legend box.
  129.  
  130.  
  131. RETURN VALUES:
  132.  
  133. "0" - No error
  134. "1" - Wrong number of parameters (must supply 10 parameters)
  135. "2" - Bad rectangles. graphRect must be enclosed within outerRect
  136. "3" - The graphRect must be a square (i.e., only round pies!)
  137. "4" - Too many data points (maximum is 10 for a pie chart, 50 for 
  138. line or bar graph).
  139.  
  140. See DEMO.PRG for sample usage and a demonstration of the XFCN's 
  141. features.
  142.  
  143.  
  144. USAGE NOTES AND TIPS: 
  145.  
  146. The graph rectangle must be entirely enclosed within the outer, 
  147. framing rectangle. 
  148.  
  149. Pies charts must have a square graph rectangle. 
  150.  
  151. X-axis labels may overlap if the graph is not wide enough. 
  152. Skipping labels (e.g., showing every other one) is one way around 
  153. this problem if a graph can't be made larger. 
  154.  
  155. If fixed scaling is selected, you must supply a minimum and 
  156. maximum value, or no data will display.
  157.  
  158. Styles may be combined in your program (e.g., bold + italic), 
  159. although the DEMO.PRG does not demonstrate this. Styles are 
  160. specified as in FoxBASE+/Mac: point size plus 256 for bold, 512 
  161. for italic, and 1024 for underline. Font names must be correctly 
  162. spelled, or the text will default to Chicago.
  163.  
  164. If advancing from record to record and displaying graphs for each 
  165. displayed record, you will achieve a smoother effect by not 
  166. clearing the screen after displaying the initial graph. Anything 
  167. falling within the outer graph rectangle will be overdrawn. 
  168. However, if graph dimensions are changed, then the screen should 
  169. be cleared.
  170.  
  171. To workaround the limits of the maximum values, scale the values.
  172.  
  173.  
  174. USING THE DEMO PROGRAM
  175.  
  176. DEMO.PRG is basic and straightforward. Some sample data is 
  177. provided for demonstration of graph features, and the code will 
  178. give an example of how to use plotGraph. The "Edit Data" button 
  179. displays the data in an Edit window. The "Edit Labels" displays 
  180. the values used for X-Axis labels and in the pie chart legend. 
  181. Click on "Plot It" to re-draw the graph with currently selected 
  182. parameters. The graph appears on Screen 2. Click "Done" to exit to 
  183. FoxBASE+/Mac. The left and right arrows will back-up or advance 
  184. through the sample data, and re-draw the graph for the new data. 
  185. As an added feature, each time a graph is drawn, it is also saved 
  186. in a picture field in the Sample.DBF file. This demonstrates how 
  187. to capture graphs for later display, or for inclusion in a report. 
  188.  
  189.  
  190. QUESTIONS, COMMENTS, SUGGESTIONS, COMPLAINTS, ETC.
  191.  
  192. Send e-mail to jdav@well.sf.ca.us (from Compuserve, that would be 
  193. >INTERNET:jdav@well.sf.ca.us).
  194.  
  195.  
  196. TOOLS:
  197.  
  198. I used MPW C.
  199.  
  200. Better late than never!
  201.